package com.njitzx.fileupload.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
//@ConfigurationProperties(prefix = "minio")
public class MinioConfig {

    @Value("${minio.accessKey}")
    private String accessKey;
    @Value("${minio.secretKey}")
    private String secretKey;
    @Value("${minio.endpoint}")
    private String endPoint;


    @Bean
    public MinioClient minioClient() {
        return MinioClient.builder().endpoint(endPoint)
                .credentials(accessKey, secretKey).build();
    }
}
